import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    children:[
      {
        path: '/lunbo',
        name: 'lunbo',
        component: () => import('../views/lunbo.vue')
      },
      {
        path: '/news',
        name: 'news',
        component: () => import('../views/news.vue')
      },
     
      {
        path: '/about',
        name: 'about',
        component: () => import('../views/AboutView.vue')
      },
      {
        path: '/product',
        name: 'product',
        component: () => import('../views/product.vue')
      },
      {
        path: '/user',
        name: 'user',
        component: () => import('../views/user.vue')
      },
      {
        path: '/comments',
        name: 'comments',
        component: () => import('../views/comments.vue')
      },

    ]
  },

  {
    path: '/login',
    name: 'login',
    component: () => import('../views/login.vue')
  },
]

const router = new VueRouter({
  routes
})

export default router
